package com;

import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Properties;



public class Demo1 {
	public static void main(String[] args) throws IOException {
		//System.out.println(new Date());
		//System.out.println("222".compareTo("222"));
		SimpleDateFormat formatterTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		 Calendar calendar = Calendar.getInstance();
	        String nowTime = formatterTime.format(calendar.getTime());
	        calendar.add(Calendar.DATE, -1);
	        String lastDayTime = formatterTime.format(calendar.getTime());
	        System.out.println(nowTime+"-----"+lastDayTime);
	        System.out.println(nowTime.compareTo(lastDayTime));
	}
}
